/// @author:  JoeKai
/// @date 2022/6/27 09:14
/// @explain： 

// ignore: camel_case_types
class CategoryModel {
  int? id;
  int? pid;
  String? cateName;
  String? pic;
  String? bigPic;
  List<CategoryChildren>? children;

  CategoryModel(
      {this.id, this.pid, this.cateName, this.pic, this.bigPic, this.children});

  CategoryModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    pid = json['pid'];
    cateName = json['cate_name'];
    pic = json['pic'];
    bigPic = json['big_pic'];
    if (json['children'] != null) {
      children = <CategoryChildren>[];
      json['children'].forEach((v) {
        children!.add(new CategoryChildren.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['pid'] = this.pid;
    data['cate_name'] = this.cateName;
    data['pic'] = this.pic;
    data['big_pic'] = this.bigPic;
    if (this.children != null) {
      data['children'] = this.children!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class CategoryChildren {
  int? id;
  String? cateName;
  String? pic;
  String? bigPic;

  CategoryChildren({this.id, this.cateName, this.pic, this.bigPic});

  CategoryChildren.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    cateName = json['cate_name'];
    pic = json['pic'];
    bigPic = json['big_pic'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['cate_name'] = this.cateName;
    data['pic'] = this.pic;
    data['big_pic'] = this.bigPic;
    return data;
  }
}
